home *** CD-ROM | disk | FTP | other *** search
- /*sp_init_mac.p - initilize the mac operating system*/
- /*initilize the mac operating system, set up the menu bar*/
-
- #include "sp.h"
- #include "sc_event.h"
- #include "sp_menu.h"
-
- void init_mac()
- {InitGraf(&thePort);
- InitFonts();
- FlushEvents(everyEvent,0);
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs(NIL);
- InitCursor();
- MaxApplZone();
- {int i;
- for(i=0;i<NUM_MASTS;i++)
- MoreMasters();
- } /*end declare i*/
- SetRect(&dragRect,
- 4,24,screenBits.bounds.right-4,screenBits.bounds.bottom-4);
-
- {int scan_menu; /*step thru menus to initilize*/
- MenuHandle amenu; /*each menu as its resource is read*/
- int resid; /*each resource id*/
- /*get each menu from the resource file*/
- for(scan_menu=MENU_first;scan_menu<=MENU_max;scan_menu++) {
- resid=scan_menu+gl.res_base; /*compute resource id to read*/
- amenu=GetMenu(resid); /*read the next menu*/
- menu_handles[scan_menu]=amenu; /*remember it*/
- if(amenu==NIL) /*report failure*/
- bomb(BOMB_nomenu,BMB_no_os,resid);
- InsertMenu(menu_handles[scan_menu],0);
- } /*for*/
- } /*variable for reading menus*/
-
- /*add the desk accessories*/
- AddResMenu(menu_handles[MENU_apple], 'DRVR');
-
- DrawMenuBar(); /*the menu bar is set up, paint it*/
- }
-